//
//  HWMyGameYouXiCollectionViewCell.m
//  HWPromoteProjectAPP
//
//  Created by 陈道斌 on 2020/3/3.
//  Copyright © 2020 陈道斌. All rights reserved.
//

#import "HWMyGameYouXiCollectionViewCell.h"
#import "HWPromoteGameModel.h"

@interface HWMyGameYouXiCollectionViewCell()
@property(strong,nonatomic) UIImageView *icoiamgeView;
@property(strong,nonatomic) UIImageView *fenxianTubiaoImageView;
@property(strong,nonatomic) UILabel *typeLabel;
@property(strong,nonatomic) UILabel *bilieLabel;
@property(strong,nonatomic) UILabel *mingchengNameLabel;
@property(strong,nonatomic) UIView *hengxiangView;



@end

@implementation HWMyGameYouXiCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    
    
    if (self = [super initWithFrame:frame]) {
        
        // 设置UI
        [self setupUI];
        
    }
    
    return  self;
    
}
// 设置UI
- (void)setupUI {
    
    self.icoiamgeView = [[UIImageView alloc]initWithFrame:CGRectMake(10*CFLScaleValue, 10*CFLScaleValue, 76*CFLScaleValue, 76*CFLScaleValue)];
    self.icoiamgeView.backgroundColor = [UIColor redColor];
    self.icoiamgeView.layer.cornerRadius = 12;
    self.icoiamgeView.layer.masksToBounds = YES;
    
    
    [self.contentView addSubview: self.icoiamgeView];
    
    self.fenxianTubiaoImageView = [[UIImageView alloc]initWithFrame:CGRectMake(96*CFLScaleValue-24*CFLScaleValue, 0, 24*CFLScaleValue, 24*CFLScaleValue)];
   // self.fenxianTubiaoImageView.backgroundColor = [UIColor whiteColor];
    self.fenxianTubiaoImageView.image = [UIImage imageNamed:@"fenxiangyouxi_ico"];
    [self.contentView addSubview: self.fenxianTubiaoImageView];
    
     UILabel *zongrenLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*CFLScaleValue, 86*CFLScaleValue, 76*CFLScaleValue/2, 29)];
      zongrenLabel.text = [NSString stringWithFormat:@"总%@",@"jj"];
      self.typeLabel = zongrenLabel;
      zongrenLabel.font = [UIFont systemFontOfSize:12];
     // zongrenLabel.textColor = [UIColor whiteColor];
      zongrenLabel.numberOfLines = 2 ;
      zongrenLabel.textAlignment = NSTextAlignmentLeft;
      zongrenLabel.textColor = RGB(193, 193, 203);
    zongrenLabel.backgroundColor = [UIColor whiteColor];
    
      [self.contentView addSubview:zongrenLabel];
    
    
    
      UILabel *bilieLabel = [[UILabel alloc]initWithFrame:CGRectMake(zongrenLabel.right, 86*CFLScaleValue, 76*CFLScaleValue/2, 29)];
       bilieLabel.text = [NSString stringWithFormat:@"%@",@"45%"];
       bilieLabel.font = [UIFont systemFontOfSize:12];
      // zongrenLabel.textColor = [UIColor whiteColor];
       bilieLabel.numberOfLines = 2 ;
       bilieLabel.textAlignment = NSTextAlignmentRight;
       bilieLabel.textColor = RGB(193, 193, 203);
       bilieLabel.backgroundColor = [UIColor whiteColor];
        self.bilieLabel = bilieLabel;
    
       [self.contentView addSubview:bilieLabel];
 
     self.hengxiangView = [[UIView alloc]initWithFrame:CGRectMake(0, self.bilieLabel.bottom, 96*CFLScaleValue, 1)];
     self.hengxiangView.backgroundColor = RGB(245, 245, 252);
    
     [self.contentView addSubview: self.hengxiangView];
    
    
    
         UILabel *mingchengNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.hengxiangView.bottom, 96*CFLScaleValue, 37)];
          mingchengNameLabel.text = [NSString stringWithFormat:@"%@",@"李阳王者"];
          mingchengNameLabel.font = [UIFont systemFontOfSize:17];
         // zongrenLabel.textColor = [UIColor whiteColor];
          mingchengNameLabel.numberOfLines = 1 ;
          mingchengNameLabel.textAlignment = NSTextAlignmentCenter;
          mingchengNameLabel.textColor = RGB(68, 68, 68);
          mingchengNameLabel.backgroundColor = [UIColor whiteColor];
         self.mingchengNameLabel = mingchengNameLabel;
    
       
          [self.contentView addSubview:mingchengNameLabel];
    
     
      

    
    
}

-(void)setModel:(HWPromoteGameModel *)model {
    
    _model = model;
    
    [self.icoiamgeView sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:nil];
    self.typeLabel.text = [NSString stringWithFormat:@"%@",model.type];
    self.bilieLabel.text = [NSString stringWithFormat:@"%@",model.fcbl];
      self.mingchengNameLabel.text = [NSString stringWithFormat:@"%@",model.name];
    
    
    
    
    
}
@end
